<template>
  <div class="hdgl-edit-step-5">
    <!--        其他文案-->
    <a-form-model ref="form" :model="model" label-width="160px" size="mini">
      <a-form-model-item label="取消关注消息提醒">
        <wx-reply-editor v-model="model.msgUnfollow" :splitButton="splitButton"/>
      </a-form-model-item>
      <a-form-model-item label="重复助力消息提醒">
        <wx-reply-editor v-model="model.msgRepeat" :splitButton="splitButton"/>
      </a-form-model-item>
      <a-form-model-item label="超限消息提醒">
        <wx-reply-editor v-model="model.overLimitMsg" :splitButton="splitButton"/>
      </a-form-model-item>
      <a-form-model-item label="任务完成后继续有人加入消息">
        <wx-reply-editor v-model="model.msgAfterFinish" :splitButton="splitButton"/>
      </a-form-model-item>
      <a-form-model-item label="活动结束消息">
        <wx-reply-editor v-model="model.msgOver" :splitButton="splitButton"/>
      </a-form-model-item>
    </a-form-model>
  </div>
</template>

<script>
import WxReplyEditor from './wx-reply-editor'
import { toChineseIndex } from '../../../../utils'
export default {
    name: 'HdglEditStep5',
    components: { WxReplyEditor },
    props: {
        model: {
            type: Object,
            default: () => {}
        }
    },
    data () {
        return {
            toChineseIndex
        }
    },
    computed: {
        awardList () {
            return this.model.awardList
        },
        splitButton () {
            const btnList = []
            for (let i = 0; i < this.awardList.length; i++) {
                let numCn = null
                if (i + 1 === 1) {
                    numCn = '一'
                }
                if (i + 1 === 2) {
                    numCn = '二'
                }
                if (i + 1 === 3) {
                    numCn = '三'
                }
                btnList.push({ name: numCn + '阶任务目标人数', value: this.awardList[i].target })
            }
            return { name: 'taskTargetNum', btnList: btnList }
        }
    },
    methods: {
        check () {
            // this.$refs['form'].validate((valid) => {
            //     if (valid) {
            //         alert('submit!');
            //     } else {
            //         console.log('error submit!!');
            //     }
            //     throw new Error('错误');
            // });
        }
    }
}
</script>

<style scoped>

</style>
